<?php require 'header.php'; ?>
			<div class="row">
				<div class="span3">
					<div class="well" style="padding: 8px 0;">
						<ul class="nav nav-list">
							<li class="nav-header">
								TechAfghanistan
							</li>
							<li>
								<a href="index.php"><i class="icon-home"></i> Home</a>
							</li>
							<li>
								<a href="authors.php"><i class="icon-user"></i> Authors</a>
							</li>
							<li>
								<a href="posts.php"><i class="icon-th-list"></i> Posts</a>
							</li>
						</ul>
					</div>
				</div>
			<div class="span9">
					<h2>
						Posts
					</h2>
					<?php if(isset($_GET['delete'])){
						?>
						<div class="alert alert-warning">Post Deleted Successfully</div>
						<?php

					} ?>
					<table class="table table-bordered">
						<thead>
							<tr>
								<th>
									#
								</th>
								<th style="width:30%">
									Title
								</th>
								<th style="width:50%">
									Description
								</th>
								<th>
									Publish Date
								</th>
								<th>
									Physical Author
								</th>
								<th style="width: 20%;">
									Actions
								</th>
								
								
								</tr>
							
						</thead>
						<tbody>
							<?php
								$authorSelectQry = $conn->query("SELECT * FROM `news` ORDER BY pub_date DESC");
								$count = 1;
								while($authorSelectRow=$authorSelectQry->fetch()){
									$select_author = $conn->query("SELECT * FROM `users` WHERE id = '".$authorSelectRow['physical_author_id']."'");
									$author = $select_author->fetch();
									$name = $author['firstname'] . " " . $author['lastname'];
								?>
								<tr><td><?php echo $count; ?></td><td><?php echo $authorSelectRow['title']; ?></td><td><?php echo $authorSelectRow['description']; ?></td><td><?php echo $authorSelectRow['pub_date']; ?></td><td><?php echo $name; ?></td><td><a href="http://tech.af/admin/execute/remove_post.php?id=<?php echo $authorSelectRow['id']; ?>">Delete</a></td></tr>
									<?php $count++;
								}
							?>
						</tbody>
						
					</table>					
				</div>
			</div>
		</div>
		<script src="js/jquery.min.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<script src="js/site.js"></script>
	</body>

<!-- Mirrored from wbpreview.com/previews/WB0070A9H/index.htm by HTTrack Website Copier/3.x [XR&CO'2013], Wed, 22 Jan 2014 10:31:21 GMT -->
</html>